<?php

use think\Facade\Route;
use think\Facade\Env;

Route::domain(Env::get('app.api_url'), function () {

    header("Access-Control-Allow-Origin: *");
    header('Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS, DELETE, HEAD, PATCH');
    header("Access-Control-Allow-Headers: token,language, Origin, X-Requested-With, Content-Type, Accept");

    Route::miss(function () {
        echo '无访问权限';
        exit();
    });

    Route::group('User', function () {
        Route::post('Register', '/Register'); //用户注册
        Route::post('Login', '/Login'); //用户登录
        Route::post('Forget', '/Forget'); //忘记找回密码
        Route::post('Cointrading', '/Cointrading'); //发布订单
        Route::get('Mytodayorder', '/Mytodayorder'); //我的订单
        Route::get('Money', '/Money'); //我的订单
        Route::post('Ordercacel', '/Ordercacel'); //取消订单
        Route::rule('UserAuth', '/UserAuth'); //实名认证
        Route::rule('Contack', '/Contack'); //实名认证
        Route::get('Info', '/Info'); //实名认证
        Route::get('Prelist', '/Prelist'); //深度
        Route::get('Prelist_detail', '/Prelist_detail'); //深度
        Route::rule('Myprelist', '/Myprelist'); //深度
        Route::get('getaddress', '/getaddress'); //深度
        Route::get('Recharge', '/Recharge'); //深度
        Route::get('Rechargelist', '/Rechargelist'); //深度
        Route::get('moneylog', '/moneylog'); //深度
        Route::get('moneytype', '/moneytype'); //深度
        Route::rule('Withdraw', '/Withdraw'); //深度
        Route::get('Withdrawlist', '/Withdrawlist'); //深度
    })->prefix('User');

    Route::group('Other', function () {
        Route::post('sendCode', '/sendCode'); //发送验证码
        Route::get('Oss', '/Oss'); //OSS
        Route::get('Quotes', '/Quotes'); //行情
        Route::get('Quotesone', '/Quotesone'); //单币种行情
        Route::get('QuotesIndex', '/QuotesIndex'); //k线
        Route::get('jiaoyiLog', '/jiaoyiLog'); //交易记录
        Route::get('orderLog', '/orderLog'); //深度
        Route::get('Annou', '/Annou'); //深度
        Route::get('Banner', '/Banner'); //深度
        Route::get('Helps', '/Helps'); //深度
        Route::get('Kefu', '/Kefu'); //深度
        Route::get('Aboutus', '/Aboutus'); //深度
    })->prefix('Other');
})->bind('api')->prefix('api');
